﻿using HiSport.Core.Entities.Auditing;
using HiSport.Core.Enum;
using SqlSugar;

namespace HiSport.Core.Entity
{

    /// <summary>
    /// 集团租户
    /// </summary>
    [SugarTable("Sys_Tenant")]//当和数据库名称不一样可以设置表别名 指定表明
    public class SysTenant : FullAuditedEntity
    {
        /// <summary>
        /// 账号
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar(50)", ColumnDescription = "账号", IsNullable = true)]
        public string Account { get; set; }

        /// <summary>
        /// 名字
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar(20)", ColumnDescription = "名字", IsNullable = true)]
        public string Name { get; set; }

        /// <summary>
        /// 主机
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar(50)", ColumnDescription = "主机", IsNullable = true)]
        public string Host { get; set; }



        /// <summary>
        /// 备注
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar(300)", ColumnDescription = "备注", IsNullable = true)]
        public string Remarks { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        [SugarColumn(ColumnDataType = "bit", ColumnDescription = "状态 0:禁用 1:启用", IsNullable = false)]
        public StatusEnum Status { get; set; } = StatusEnum.Enable;


        /// <summary>
        /// 电话
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar(32)", ColumnDescription = "电话", IsNullable = false)]
        public string Phone { get; set; }


        
        /// <summary>
        /// 租户类型
        /// </summary>
        [SugarColumn(ColumnDescription = "租户类型")]
        public TenantTypeEnum TenantType { get; set; }

        /// <summary>
        /// 数据库类型
        /// </summary>
        [SugarColumn(ColumnDescription = "数据库类型")]
        public SqlSugar.DbType DbType { get; set; }

        /// <summary>
        /// 数据库连接
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar(256)", ColumnDescription = "数据库连接", IsNullable = true)]
        public string ConnectionString { get; set; }

        /// <summary>
        /// 有效期
        /// </summary>
        [SugarColumn(ColumnDataType = "DateTime", ColumnDescription = "有效期", IsNullable = true)]
        public DateTime? ExpirationTime { get; set; }
    }
}
